package com.aaa.ssm.service.impl;

import com.aaa.ssm.dao.ArtchannelDao;
import com.aaa.ssm.entity.Artchannel;
import com.aaa.ssm.service.ArtchannelService;
import com.aaa.ssm.util.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ fileName:DicArtchannelServiceImpl
 * @ description:
 * @ createTime:2023/3/29 11:24
 * @ version:1.0.0
 */
@Service
public class ArtchannelServiceImpl implements ArtchannelService {

    //依赖注入，依赖dao
    @Resource
    private ArtchannelDao dicArtchannelDao;


    @Override
    public PageInfo queryPage(Page<Artchannel> page) {
        PageHelper.startPage(page.getPageNo(),page.getPageSize());
        return new PageInfo(dicArtchannelDao.queryPage(page.getData()));
    }

    @Override
    public int add(Artchannel dicArtchannel) {
        return dicArtchannelDao.add(dicArtchannel);
    }

    @Override
    public int delete(String code) {
        return dicArtchannelDao.delete(code);
    }

    @Override
    public int update(Artchannel dicArtchannel) {
        return dicArtchannelDao.update(dicArtchannel);
    }


}
